<template>
  <nav-bar>
    <div slot="center" class="center">{{title}}</div>
    <div slot="right">
      <van-icon name="underway-o" class="right" @click="toBackMain"/>
    </div>
  </nav-bar>
</template>

<script>
import NavBar from "@/components/common/navbar/NavBar";

import { mapMutations } from "vuex"

export default {
  name: "",
  props: {
    title:{
      type:String,
      default:''
    }
  },
  components: {
    NavBar,
  },
  methods:{
    ...mapMutations({
      getCurrentRentPath:"moduleUser/getCurrentRentPath"
    }),
    toBackMain(){
      this.$router.replace('/rentstate/allstate')
      this.getCurrentRentPath('/rentstate/allstate')
      localStorage.setItem("currentRentPath",'/rentstate/allstate')
    }
  }
};
</script>

<style scoped>
.center {
  color: #fff;
  font-size: 16px;;
}
.left,
.right {
  font-size: 23px;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>